package com.nexus.all.enums;

/**
 * @Comments: ai操作枚举
 */
public enum AiOperateEnum {
    BIND_COUNT((byte) 1, "绑定账号"),
    CREATE_NOTE((byte) 2,"发布笔记"),
    GET_NOT_SENT_MAIL((byte) 10, "查询未发送邮件"),
    ADD_USER_TIME_MAIL((byte) 11, "设置新的时间邮件"),
    ;

    private byte value;
    private String desc;

    AiOperateEnum(byte value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static boolean exists(Byte status) {
        if (status == null) {
            return false;
        }
        byte s = status.byteValue();
        return exists(s);
    }

    public static boolean exists(byte s) {
        for (AiOperateEnum element : AiOperateEnum.values()) {
            if (element.value == s) {
                return true;
            }
        }
        return false;
    }

    public boolean equal(Byte val) {
        return val == null ? false : val.byteValue() == this.value;
    }

    public static String getDescByValue(Byte value) {
        if (value == null) {
            return "";
        }
        for (AiOperateEnum element : AiOperateEnum.values()) {
            if (element.value == value.byteValue()) {
                return element.desc;
            }
        }
        return "";
    }
}
